package org.southyin.filestream;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Scanner;

public class WriteFileDemo {
    public static void main(String[] args) {
        // 输出流
        // Writer
        //  FileWriter 字符流
        //  BufferedWriter  PrintWriter
        FileWriter writer = null;
//        BufferedWriter out = null;
        PrintWriter out = null;
        try {
            writer = new FileWriter("E:/log.txt",true);
//            out = new BufferedWriter(writer);
            out = new PrintWriter(writer);
            out.println("白日依山尽");
            out.println("黄河入海流");
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            out.close();
            try {
                writer.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

    }
}
